package org.xilin

class Student implements Serializable {
//    Integer studentId
//    Long id
    String lastName
    String firstName
    String chineseName
    Date birthDay
    String gender

    static constraints = {
//        studentId(blank:false, unique : true)
        lastName(blank:false)
        firstName(blank:false)
        birthDay(nullable:false)
        gender(blank:false)
    }

    static hasMany = [classes: TheClass, books: Book]
    static belongsTo = [family: Family]

    static mapping = {
        classes lazy:false
    }

    String toString() {
        "${firstName} ${lastName}"
    }
}
